#ifndef _NON_DETERMINISM_HPP
#define _NON_DETERMINISM_HPP 1

#include "../constants.hpp"
#include <arpa/inet.h>
#include <stdio.h>
#include <boost/shared_ptr.hpp>

namespace BFT
{
	namespace messages
	{
		class NonDeterminism
		{
			public:
			
			NonDeterminism(uint64_t _time, uint64_t _seeds);
			NonDeterminism(boost::shared_ptr<char> _bytes, int _bytes_size);
			
			uint64_t getTime();
			uint64_t getSeeds();
			int getSize();
			boost::shared_ptr<char> getBytes();
			bool equals(boost::shared_ptr<NonDeterminism> _nondet);
			
			static int size();
			
			protected:
			
			boost::shared_ptr<char> bytes;
			uint64_t time; //beware of the year 2038 problem !!!!
			uint64_t seeds;
			
			private:
			
			uint32_t time_offset;
			
		};
		
		inline int NonDeterminism::getSize() {return NON_DETERMINISM_SIZE;}
		inline uint64_t NonDeterminism::getTime() {return time;}
		inline uint64_t NonDeterminism::getSeeds() {return seeds;}
		inline boost::shared_ptr<char> NonDeterminism::getBytes() {return bytes;}
	}
}

#endif
